<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="umsroot.css">
<TITLE>
Cross Referencing Tool
</TITLE>
</HEAD>
<BODY >
<A HREF="umsroot086.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="umsroot083.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="umsroot088.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc209">15.4</A>&nbsp;&nbsp;Cross Referencing Tool</H2>

The cross referencing library <B>xref</B> analyses an ECLiPSe source 
module or file and builds its predicate call graph. The graph can either 
be returned in the format of <TT>lib(graph_algorithms)</TT>, as text, or
as a graphical display.<BR>
<BR>
The <A HREF="../bips/lib/xref/xref-2.html"><B>xref/2</B></A><A NAME="@default875"></A> predicate generates
a call graph for the file <TT>File</TT> according to the <TT>Options</TT> 
list. The options specify the format of the graph to be generated, whether
calls to built in predicates are displayed and whether it is a caller
or callee graph:
<BLOCKQUOTE CLASS="quote">
<PRE CLASS="verbatim">
?- xref:xref(queen, []).
 
nodiag / 3 calls:
        nodiag / 3
 
qdelete / 4 calls:
        qdelete / 4
 
qperm / 2 calls:
        qdelete / 4
        qperm / 2
 
queen / 2 calls:
        qperm / 2
        safe / 1
 
safe / 1 calls:
        nodiag / 3
        safe / 1
 
Yes (0.01s cpu)
?- xref:xref(queen,[builtins:on,output:daVinci]).
WARNING: module 'daVinci' does not exist, loading library...
daVinci.ecl compiled traceable 5644 bytes in 0.01 seconds
</PRE></BLOCKQUOTE>
The first <TT>xref</TT> predicate call generates a textual call graph
for the <TT>queen</TT> module, while the second generates the 
<B>daVinci</B> graph illustrated in figure&nbsp;<A HREF="#xrefdavinci">15.1</A>.
<BLOCKQUOTE CLASS="figure"><DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV>
<DIV CLASS="center">
<IMG SRC="umsroot010.gif">
</DIV>
<BR>
<BR>
<DIV CLASS="center">Figure 15.1: Call graph for queen example with built-in predicates</DIV><BR>
<BR>

<A NAME="xrefdavinci"></A>
<DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV></BLOCKQUOTE>
<HR>
<A HREF="umsroot086.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="umsroot083.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="umsroot088.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
